package com.starhub.api.docwriting.result;

import com.starhub.api.docwriting.vo.WritingRecordVO;

import lombok.Data;

/**   
 * 写作记录处理结果
 * @version: V1.0
 * @author: liuhf
 * @time 2025-05-18
 */
@Data
public class WritingRecordDealResult {

    private String dataId;
    private WritingRecordVO writingRecord;
    private String message;
    private boolean success;

    public static WritingRecordDealResult fail(String message) {
        WritingRecordDealResult result = new WritingRecordDealResult();
        result.setSuccess(false);
        result.setMessage(message);
        return result;
    }

    public static WritingRecordDealResult success(Long dataId) {
        WritingRecordDealResult result = new WritingRecordDealResult();
        result.setDataId(dataId.toString());
        result.setSuccess(true);
        return result;
    }

    public static WritingRecordDealResult success(Long dataId, String message) {
        WritingRecordDealResult result = new WritingRecordDealResult();
        result.setDataId(dataId.toString());
        result.setSuccess(true);
        return result;
    }

    public static WritingRecordDealResult success(Long dataId, WritingRecordVO writingRecord) {
        WritingRecordDealResult result = new WritingRecordDealResult();
        result.setDataId(dataId.toString());
        result.setWritingRecord(writingRecord);
        result.setSuccess(true);
        return result;
    }
}
